from alisdk import ECSHandler
from devops.config import ALICLOUD


def get_hosts_from_aliyun():
    """
    从阿里云获取ECS实例并入库
    :return:
    """
    ecs = ECSHandler(*ALICLOUD['access_key'], ALICLOUD['region'])
    instances, exception, next_page = ecs.get_instances(page_size=14)
    print(instances)
    return "hello"


if __name__ == '__main__':
    get_hosts_from_aliyun()